<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../include/laypublic.jsp" %>
<%@ include file="../include/vueComponent.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title>风险总览详情</title>
</head>
<link rel="stylesheet" href="${ctx}/resources/vue-element-lib/detail.css">
<body>
<div id="app">
    <div class="layui-tab layui-tab-brief" lay-filter="xqxx-tab-all">
        <ul class="layui-tab-title">
            <li id="tbglId" class="layui-this" lay-id="0">风险总览详情</li>
        </ul>
        <div class="layui-tab-right">
            <%--标书评审-技术标--%>
            <template v-if="layId==0">
                <button type="button" class="layui-btn layui-btn-primary layui-btn-radius" @click="back">返回</button>
            </template>
        </div>
        <div class="layui-tab-content" style="height: 100px;">
            <div class="layui-tab-item layui-show">
                <div class="container">
                    <el-form ref="formRef" label-width="180px" label-suffix="："
                             label-position="left">
                        <%--项目基础信息--%>
                        <div class="title">
                            <h3>项目基础信息</h3>
                        </div>
                        <!--表单-->
                        <el-row>
                            <x-col>
                                <el-form-item label="项目名称">
                                    <span>{{projectInfo.proName}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="项目类型">
                                    <span>{{projectInfo.proTypes==1?'PPP项目':''}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="项目编码">
                                    <span>{{projectInfo.proCode}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="项目所属城市">
                                    <span>{{projectInfo.cityName}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="项目地址">
                                    <span>{{projectInfo.proAddress}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="投资总额(万元)">
                                    <span>{{projectInfo.sumAmount}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="一般公共预算收入(万元)">
                                    <span>{{projectInfo.pubIncome}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="建安工程费用(万元)">
                                    <span>{{rowSum}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <%--风险信息--%>
                        <div class="title">
                            <h3>风险信息</h3>
                        </div>
                        <el-row>
                            <x-col>
                                <el-form-item label="创建时间">
                                    <span>{{projectRisk.addTime}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="项目阶段">
                                    <span>{{typeName}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="跟踪人员">
                                    <span>{{projectRisk.staffName}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="处理策略">
                                    <x-select v-model="projectRisk.solveWay" name="处理策略" disabled
                                              :options="riskSolveWays"></x-select>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="风险来源">
                                    <el-input v-model="projectRisk.riskStageName" disabled></el-input>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="风险等级">
                                    <x-select v-model="projectRisk.riskLevel" name="风险等级"
                                              :options="riskLevels" disabled></x-select>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="风险描述">
                                    <el-input v-model="projectRisk.riskDesc" disabled type="textarea"
                                              :rows="4"></el-input>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="销项时间">
                                    <span>{{projectRisk.updateTime}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="销项人">
                                    <span>{{projectRisk.sellName}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                    </el-form>
                </div>
            </div>
            <div class="layui-tab-item">
                <%@ include file="process/process-history.jsp" %>
            </div>
            <div class="layui-tab-item">
                <%@ include file="process/process-audit.jsp" %>
            </div>
        </div>
    </div>
</div>
<%--<div id="app">
    <div class="head">
        <div class="left">风险总览详情</div>
        <div class="right">
            <button type="button" class="layui-btn layui-btn-primary layui-btn-radius" @click="save(0)">保存</button>
            <button type="button" class="layui-btn layui-btn-radius" @click="save(1)">提交</button>
        </div>
    </div>
</div>--%>
<script src="${ctx}/resources/vue-element-lib/jquery.js"></script>
<script>
    let fileArr = [];
    var staticPath = '${fileHttpPre}';
    layui.config({
        base: '${ctx}/resources/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'set', 'upload', 'table', 'transfer', 'laydate', 'element', 'layer'], function () {
        var $ = layui.$
            , upload = layui.upload
            , table = layui.table
            , element = layui.element
            , layer = layui.layer;

        //选项卡切换监听
        element.on('tab(xqxx-tab-all)', function (data) {
            var layId = $(this).attr('lay-id');
            vm.$data.layId = layId
            if (layId === "0") {

            } else if (layId === "1") {
                loadTable(layId);
            } else if (layId === "2") {

            }
        });

       
    });

    //删除文件
    function del(index) {
        layui.$("#fileAtt_" + index).remove();
        layui.$("#upload_img_" + index).remove();
        fileArr.map((el, idx) => {
            if (el.split('|')[2] == index) {
                fileArr.splice(idx, 1)
            }
        })
    }

    //根据url查看文件
    function showImg(url) {
        var openWin = window.open(url, '', 'left=410,height=768, width=1024, top=200,  toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
    }

    /*核心*/
    var vm = new Vue({
        el: '#app',
        data() {
            return {
                layId: '0',
                procNodeList: [],
                tempNodeList: [],
                auditMsg: '',//审批意见
                riskLevels: [],      //风险等级
                riskSolveWays: [],      //处理策略

                options: [],
                checkList: [],
                value1: '',
                projectInfo: {},
                tableData: [
                    {name: '投标组长', num: '', total: ''},
                    {name: '资信', num: '', total: ''},
                    {name: '测算', num: '', total: ''},
                    {name: '技术', num: '', total: ''},
                ],
                projectRisk: {},
                id: '',
                rowSum:'',
                typeName:'',
            }
        },
        created() {
            let that = this;
            that.id = "${id}";
            console.log(that.id)
            that.queryDetailById();
        },
        mounted() {

        },
        methods: {
            back(){

            },
            //详情
            queryDetailById() {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/riskOverview/queryDetail',
                    data: {
                        id: that.id
                    },
                    success: function (result) {
                        if (result.success) {
                            that.projectInfo = result.entity.projectInfo;
                            that.projectRisk = result.entity.projectRisk;
                            that.rowSum = result.entity.rowSum;
                            that.typeName = result.entity.typeName;
                            if (that.projectInfo) {
                                let projectChannel = result.entity.projectInfo.projectChannel
                                if (projectChannel && projectChannel.length > 0) {
                                    if (that.projectRisk && that.projectRisk.proStage) {
                                        projectChannel.map(el => {
                                            if (el.node == that.projectRisk.proStage) {
                                                that.projectRisk.proStage = el.nodeName;
                                            }
                                        })
                                    }
                                }
                                // projectChannel
                            }
                            if (result.entity.projectRisk) {
                                //风险等级
                                that.riskLevels = result.entity.projectRisk.riskLevels;
                                //处理策略
                                that.riskSolveWays = result.entity.projectRisk.riskSolveWays;
                            }
                        }
                    }
                });
            },
        }
    })
</script>
</body>
</html>

